
//系统目录 / 西药 接口相关的函数
import request from "../untils/request.js"

/**
 * 
 *  post
 *  
 */

//登录函数
export const login = (data) => {
    return request.post("/outpatient/login",data)
}

//新增药品目录
export const addDrugs = (data) => {
    return request.post("/outpatient/addDrugs", data )
}

//修改药典目录
export const updateDrugCatalogue = (data) => {
    return request.post("/outpatient/updateDrugCatalogue", data )
}

//新建西成药目录
export const addDrugInformation = (data) => {
    return request.post("/outpatient/addDrugInformation", data )
}

//修改西成药目录
export const updateDrugInformation = (data) => {
    return request.post("/outpatient/updateDrugInformation", data )
}

/**
 * 
 * get 
 *  
 */

// 获取医保编码
export const getPariCode = (params) => {
    return request.get("/outpatient/getPariCode", { params })
}

// 用于新增西成药药典名称
export const getDInfo = (params) => {
    return request.get("/outpatient/getDInfo", { params })
}

// 用于新增西成药 包装单位
export const getDrugUnt = (params) => {
    return request.get("/outpatient/getDrugUnt", { params })
}

// 用于新增西成药 单位剂量 最小剂量
export const getDosaUnt = (params) => {
    return request.get("/outpatient/getDosaUnt", { params })
}

// 默认给药方式
export const getMedicationFrequency = (params) => {
    return request.get("/outpatient/getMedicationFrequency", { params })
}

// 默认用药频率
export const getMedicationWay = (params) => {
    return request.get("/outpatient/getMedicationWay", { params })
}

// 毒麻类型
export const selectDocVtByType = (params) => {
    return request.get("/outpatient/selectDocVtByType", { params })
}

// 卫材类型
export const getEisai = (params) => {
    return request.get("/outpatient/getEisai", { params })
}

// // 卫材属性
// export const getMedicationWay = (params) => {
//     return request.get("/outpatient/getMedicationWay", { params })
// }

// 树菜单
export const AllTree = (params) => {
    return request.get("/outpatient/selectAllDrugCategory", { params })
}

// 药典目录列表
export const selectDrugCatalogue = (params) => {
    return request.get("/outpatient/selectDrugCatalogue", { params })
}

// 本位码
export const ProductNameCode = (params) => {
    return request.get("/outpatient/selectByProductName", { params })
}

// 通过树形结构为参数比如点击西药就查出西药的数据查询对应的数据
export const getDrugType = (params) => {
    return request.get("/outpatient/getDrugType", { params })
}

// 公共目录的树形结构 （药品类型）
export const selectCateGory = (params) => {
    return request.get("/outpatient/selectCateGory", { params })
}

// 药物类别
export const selectOneCateGory = (params) => {
    return request.get("/outpatient/selectOneCateGory", { params })
}

// 药物类别2级分类 药理子类别
export const selectTwoCateGory = (params) => {
    return request.get("/outpatient/selectTwoCateGory", { params })
}

// 药物类别3级分类 药理3子类别
export const selectThreeCateGory = (params) => {
    return request.get("/outpatient/selectThreeCateGory", { params })
}

// 列表，带条件查询，带分页  => 剂型
export const selectDrugDosageForm = (params) => {
    return request.get("/outpatient/selectDrugDosageForm", { params })
}

// 该查询是西成药信息用于修改回填数据
export const getDInfos = (params) => {
    return request.get("/outpatient/getDInfos", { params })
}

//病案费别
export const getMedcas = (params) => {
    return request.get("/outpatient/getMedcas", { params })
}

// 该接口只是用于药典目录新增的时候在病案费别里面用
export const getRecordCategory = (params) => {
    return request.get("/outpatient/getRecordCategory", { params })
}

// 新增药品基础信息-查询加成率
export const docMarkById = (params) => {
    return request.get("/outpatient/docMark/getById", { params })
}

// 获取厂家信息
export const getManufacturer = (params) => {
    return request.get("/outpatient/getManufacturer", { params })
}
// 获取药品加成率 => 中药
export const getDocMark = (params) => {
    return request.get("/outpatient/docMark/page", { params })
}
// 该查询是西成药厂家信息用于修改回填数据
export const getDrugManufacturer = (params) => {
    return request.get("/outpatient/getDrugManufacturer", { params })
}
/**
 * 
 * DELETE 
 *  
 */
//删除
export const deleteDrugP = (params) => {
    return request.delete("/outpatient/deleteDrugP", { params })
}

// 暴露
export default{
getPariCode,
AllTree,getDInfo,getDrugUnt,getDosaUnt,addDrugInformation,getMedicationFrequency,getMedicationWay,getEisai,deleteDrugP,updateDrugInformation,getDInfos,
ProductNameCode,getDrugType,selectCateGory,selectOneCateGory,selectTwoCateGory,selectThreeCateGory,selectDrugCatalogue,getDocMark,
selectDrugDosageForm,
selectDocVtByType,getMedcas,addDrugs,updateDrugCatalogue,getRecordCategory,
getManufacturer,getDrugManufacturer
}